<?php

namespace app\service\payment\factory;

use app\model\Orders;
use app\service\payment\gateway\PaymentInterface;
use think\Request;

abstract class AbstractPaymentFactory
{
    abstract function gateway():PaymentInterface;

    //创建订单
    public function createOrder(Orders $order,Request $request)
    {
        return $this->gateway()->placeOrder($order,$request);
    }

    //加购
    public function upsell(Orders $order,Request $request)
    {
        return $this->gateway()->repurchase($order,$request);
    }



}